<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title>Reset Password</title>
    </h:head> 
    <body>
        <ui:composition template="./Template/generalTemplate.xhtml">

            <ui:define name="content">

                <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>
                <p:dialog modal="true" widgetVar="statusDialog" header="Please wait"   
                          draggable="false" closable="false">  
                    <p:graphicImage value="/images/ajaxloadingbar.gif" />  
                </p:dialog>
                <h:form> 
                    <p:panel id="resetP" header="Verification" style="height:495px;">
                        <p:growl id="statusMessages" showDetail="true" />
                        <div style="margin-top:100px;margin-left:250px;">
                            <h:panelGrid id="resetPassword" columns="3">
                                <h:outputText value ="User Name "/>
                                <h:inputText value ="#{resetPasswordManagedBean.userName}"/>
                                <br/>
                                <h:outputText value ="Date Of Birth(dd-mm-yyyy)"/>
                                <p:inputMask value="#{resetPasswordManagedBean.DOB}" mask="99-99-9999"/>
                                <br/> 
                                <h:outputText value ="Please select a security question:"/>
                                <h:selectOneMenu value="#{resetPasswordManagedBean.securityQuestion}" >
                                    <f:selectItem itemLabel="What's your mother's surname?" itemValue="question1" />
                                    <f:selectItem itemLabel="What's the name of your primary school?" itemValue="question2" />
                                    <f:selectItem itemLabel="What's your best friend's name?" itemValue="question3" />
                                    <f:selectItem itemLabel="What's your favourite food?" itemValue="question4" />
                                </h:selectOneMenu>
                                <br/> 
                                <h:outputText value ="Your Answer"/>
                                <h:inputText value="#{resetPasswordManagedBean.ans}" requiredMessage="Answer cannot be empty" required="true" />
                                <br/> 
                                <p:commandButton value ="Submit" ajax ="true" update ="statusMessages" actionListener = "#{resetPasswordManagedBean.doVerify}" />



                            </h:panelGrid>
                        </div>
                    </p:panel>
                </h:form>

            </ui:define>

        </ui:composition>   
    </body>
</html>
